package com.midian.model.permission;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.midian.model.common.BaseModel;
import com.midian.model.user.User;

/**
 * 角色人员中间实体
 * @author Mengfh
 *
 */
@Entity
@Table(name = "role_users")
public class RoleUser extends BaseModel {
	
	private static final long serialVersionUID = 2702194955080604246L;
	
	/**角色对象*/
	@ManyToOne(optional = true, fetch = FetchType.LAZY)
	@JoinColumn(name = "roleId")
	private Role role;
	/**用户对象*/
	@ManyToOne(optional = true, fetch = FetchType.LAZY)
	@JoinColumn(name = "userId")
	private User user;

	public Role getRole() {
		return role;
	}

	public void setRole(Role role) {
		this.role = role;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
}
